package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@TableName("article")
@ApiModel("文章类")
public class Article {
    @TableId(value = "article_id")
    @ApiModelProperty("文章id")
    private int arid;
    @TableField("article_title")
    @ApiModelProperty("文章标题")
    private String title;
    @TableField("article_content")
    @ApiModelProperty("文章内容")
    private String cont;
    @TableField("author_id")
    @ApiModelProperty("作者id")
    private int auid;
    @TableField("create_time")
    @ApiModelProperty("发表文章时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date time;
    @TableField("article_status")
    @ApiModelProperty("文章状态")
    private int stat;
    @TableField("article_type")
    @ApiModelProperty("文章类型")
    private int type;

    public Article() {
    }

    public Article(int arid, String title, String cont, int auid, Date time, int stat, int type) {
        this.arid = arid;
        this.title = title;
        this.cont = cont;
        this.auid = auid;
        this.time = time;
        this.stat = stat;
        this.type = type;
    }

    public int getArid() {
        return arid;
    }

    public void setArid(int arid) {
        this.arid = arid;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getCont() {
        return cont;
    }

    public void setCont(String cont) {
        this.cont = cont;
    }

    public int getAuid() {
        return auid;
    }

    public void setAuid(int auid) {
        this.auid = auid;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public int getStat() {
        return stat;
    }

    public void setStat(int stat) {
        this.stat = stat;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "Article{" +
                "arid=" + arid +
                ", title='" + title + '\'' +
                ", con='" + cont + '\'' +
                ", auid=" + auid +
                ", time=" + time +
                ", type=" + type +
                ", stat=" + stat +
                '}';
    }
}
